import request from '@/utils/request'

// 查询单位列表
export function listMeasure(query) {
  return request({
    url: '/maindata/unit/list',
    method: 'get',
    params: query
  })
}
//添加单位
export function addMeasure(data) {
  return request({
    url: '/maindata/unit/add',
    method: 'post',
    data: data
  })
}
//修改单位
export function updateMeasure(data) {
  return request({
    url: '/maindata/unit/update/' + unitId,
    method: 'post',
    data: data
  })
}

//查询所有主单位
export function primaryMeasure(query) {
  return request({
    url: '/maindata/unit/list/primary',
    method: 'get',
    params: query
  })
  }

  // 查询详细
  export function getUnit(unitId) {
    return request({
      url: '/maindata/unit/' + unitId,
      method: 'get'
    })
  }

  //删除单位
  export function delMeasure(unitId) {
    return request({
      url: '/maindata/unit/delete/' + unitId,
      method: 'delete'

    })
}
